<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>事件</title>
</head>
<body>
<div id="app">
    <button v-on:click="sayHi">click me</button>
    <button @click="sayHi">click me</button>
</div>

<!--导入Vue-->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script>
    var vm = new Vue({
        el:"#app",
        data: {
            message: 'xxx'
        },
        methods: {
            sayHi() {
                alert(this.message);
            }
        }
    });
</script>
</body>
</html>
